package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.mapper.CarCostInvoiceMapper;
import com.ly.heart.service.ICarCostInvoiceService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.CarCostInvoiceEntity;

import javax.annotation.Resource;

/**
 * 车辆费用单收票信息Service业务层处理
 *
 * @author cxl
 * @date 2024-09-08
 */
@Service
public class CarCostInvoiceServiceImpl extends ServiceImpl<CarCostInvoiceMapper,CarCostInvoiceEntity> implements ICarCostInvoiceService {

    @Resource
    private CarCostInvoiceMapper carCostInvoiceMapper;

    /**
     * 查询车辆费用单收票信息
     *
     * @param id 车辆费用单收票信息ID
     * @return 车辆费用单收票信息
     */
    @Override
    public CarCostInvoiceEntity selectCarCostInvoiceEntityById(String id)
    {
        return carCostInvoiceMapper.selectCarCostInvoiceEntityById(id);
    }

    /**
     * 查询车辆费用单收票信息列表
     *
     * @param carCostInvoiceEntity 车辆费用单收票信息
     * @return 车辆费用单收票信息
     */
    @Override
    public List<CarCostInvoiceEntity> selectCarCostInvoiceEntityList(CarCostInvoiceEntity carCostInvoiceEntity)
    {
        return carCostInvoiceMapper.selectCarCostInvoiceEntityList(carCostInvoiceEntity);
    }

    /**
     * 新增车辆费用单收票信息
     *
     * @param carCostInvoiceEntity 车辆费用单收票信息
     * @return 结果
     */
    @Override
    public int insertCarCostInvoiceEntity(CarCostInvoiceEntity carCostInvoiceEntity)
    {
        carCostInvoiceEntity.setCreateTime(DateUtils.getNowDate());
        return carCostInvoiceMapper.insertCarCostInvoiceEntity(carCostInvoiceEntity);
    }

    /**
     * 修改车辆费用单收票信息
     *
     * @param carCostInvoiceEntity 车辆费用单收票信息
     * @return 结果
     */
    @Override
    public int updateCarCostInvoiceEntity(CarCostInvoiceEntity carCostInvoiceEntity)
    {
        carCostInvoiceEntity.setUpdateTime(DateUtils.getNowDate());
        return carCostInvoiceMapper.updateCarCostInvoiceEntity(carCostInvoiceEntity);
    }

    /**
     * 批量删除车辆费用单收票信息
     *
     * @param ids 需要删除的车辆费用单收票信息ID
     * @return 结果
     */
    @Override
    public int deleteCarCostInvoiceEntityByIds(String[] ids)
    {
        return carCostInvoiceMapper.deleteCarCostInvoiceEntityByIds(ids);
    }

    /**
     * 删除车辆费用单收票信息信息
     *
     * @param id 车辆费用单收票信息ID
     * @return 结果
     */
    @Override
    public int deleteCarCostInvoiceEntityById(String id)
    {
        return carCostInvoiceMapper.deleteCarCostInvoiceEntityById(id);
    }
}
